﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>付款成功页面</title>
    <link rel="stylesheet" type="text/css"
          href="../AmazeUI-2.4.2/assets/css/amazeui.css"/>
    <link href="../AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet"
          type="text/css">
    <link href="../basic/css/demo.css" rel="stylesheet" type="text/css"/>

    <link href="../css/sustyle.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="../basic/js/jquery-1.7.min.js"></script>

</head>

<body>


<!--顶部导航条 -->
<div class="am-container header">

    <ul class="message-r">
        <div class="topMessage home">
            <div class="menu-hd">
                <a href="./home.html" target="_top" class="h">商城首页</a>
            </div>
        </div>
        <div class="topMessage my-shangcheng">
            <div class="menu-hd MyShangcheng">
                <a href="../person/index.html" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a>
            </div>
        </div>
        <div class="topMessage mini-cart">
            <div class="menu-hd">
                <a id="mc-menu-hd" href="./shopcart.html" target="_top"><i
                        class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong
                        id="J_MiniCartNum" class="h"></strong></a>
            </div>
        </div>
        <div class="topMessage favorite">
            <div class="menu-hd">
<!--                <a href="#" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a>-->
            </div>
        </div>
    </ul>
</div>

<!--悬浮搜索框-->

<div class="nav white">
    <div class="logo">
        <img src="../images/logo.png"/>
    </div>
    <div class="logoBig">
        <li><img src="../images/logobig.png"/></li>
    </div>

    <div class="search-bar pr">
        <a name="index_none_header_sysc" href="#"></a>
        <form>
            <input id="searchInput" name="index_none_header_sysc" type="text"
                   placeholder="搜索" autocomplete="off"> <input
                id="ai-topsearch" class="submit" value="搜索" index="1" type="button">
        </form>
    </div>
</div>
<script type="text/javascript">
    //点击搜索按钮
    $("#ai-topsearch").click(function (){
        if ($("#searchInput").val().length==0){
            layer.msg('未输入关键字!', {icon: 1, time: 1000});
            return;
        }
        location.href="./search.html?key="+$("#searchInput").val();
    });
</script>
<div class="clear"></div>


<div class="take-delivery">
    <div class="status">
        <h2 class="pay-h">您已成功付款</h2>
        <div class="successInfo">
            <ul>
                <li>付款金额<em class="money-em"></em></li>

                <li>支付宝交易号<em class="alipay-em"></em></li>
                <!--                <div class="user-info">-->
                <!--                    <p>收货人：艾迪</p>-->
                <!--                    <p>联系电话：15871145629</p>-->
                <!--                    <p>收货地址：湖北省 武汉市 武昌区 东湖路75号众环大厦</p>-->
                <!--                </div>-->
                请认真核对您的收货信息，如有错误请联系客服

            </ul>
            <div class="option">
                <span class="info">您可以</span> <a href="../person/order.html" class="J_MakePoint">查看<span>已买到的宝贝</span>
            </a> <a href="../person/orderinfo.html" class="J_MakePoint">查看<span>交易详情</span></a>
            </div>
        </div>
    </div>
</div>


<div class="footer">
    <div class="footer-hd">
        <p>  <b>|</b> <a href="#">商城首页</a> <b>|</b> <a
                href="#">支付宝</a> <b>|</b> <a href="#">物流</a>
        </p>
    </div>
    <div class="footer-bd">
        <p style="text-align: center;">
            <a href="#">合作伙伴</a> <a href="#">联系我们</a> <a href="#">网站地图</a> <em
                style="text-align: center;">© 2015-2025 zking 版权所有</em>
        </p>
    </div>
</div>
<script type="text/javascript">
    //判断用户是否已经登录
    function isLogin() {
        $.ajax({
            url: "http://localhost:8080/SnacksShop/user.do?type=isLogin",
            type: "post",
            crossDomain: true,
            xhrFields: {
                withCredentials: true
            },
            success: function (data) {
                console.log(data);
                if (data == "101"){
                    location.href = "./login.html";
                    return;
                }
                data = JSON.parse(data); //解析为Json格式
                $("#user-login-label").hide(); //隐藏登录标签
                $("#userWellcome").html("欢迎登录&nbsp;&nbsp;<span style='color: #ff0000'>" + data.requestAPI.object.userName + "</span>");
                $("#unlogin-box-guanggao").hide();//隐藏
                $("#userImg-cebian").attr("src", data.requestAPI.object.userImg);//显示侧边用户头像
                $("#userName-cebian").text("用户名:" + data.requestAPI.object.userName);//显示侧边用户名
            },
            error: function () {

            }
        })
    }
    isLogin();
</script>
<script type="text/javascript">
    //读取url中的参数
    function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] == variable) {
                return decodeURIComponent(pair[1]);
            }
        }
        return false;
    }


    //判断是否从订单页面进入
    if (getQueryVariable("type")) {
       //如果从订单页面进入则进入付款页面
        $(".successInfo").html("");
        $(".pay-h").text("等待付款中");
       location.href = "http://localhost:8080/SnacksShop/user.do"+ window.location.search;
    } else {
        //获取商品编号
        var alipay = getQueryVariable("alipay");
        var money = getQueryVariable("money");
        $(".money-em").text("¥" + money);
        $(".alipay-em").text(alipay);
        //修改订单状态
        $.ajax({
            url: "http://localhost:8080/SnacksShop/user.do?type=changeOrderStatus   ",
            type: "post",
            crossDomain: true,
            xhrFields: {
                withCredentials: true
            },
            success: function (changeOrderStatus) {
            },
            error: function () {
            }
        })
    }

</script>

</body>
</html>
